package cn.desk.commons.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import cn.desk.commons.entity.BaseEntity;
import cn.desk.commons.entity.PageMode;
import cn.desk.commons.util.QueryCondition;

public interface IBaseDao<T extends BaseEntity> {
	void insert(T t);

	void modify(T t);

	void delete(T t);

	List<T> list(T t);
	
	PageMode<T> listPage(PageMode<T> page, T t);

	T load(Class<?> clazz, Serializable pk);
	
	public List<T> listInByProperty(final Class<?> clazz,final String property, final String[] dependencies);
	
	public List<T> listByProperty(final Class<?> clazz,final String property, final Object  value);
	
	public String getMax(final Class<?> clazz,final String property);
	
	public PageMode<T> listPage(final PageMode<T> pageMode, final Class<?> clazz,
			final QueryCondition condition);
	
	public List<T> list(Class<?> clazz,QueryCondition condition);

	T loadByCondition(Class<?> class1, QueryCondition  condition);

	void exceHQL(String string, Map<String, Object> parameter);

	void merge(T t);
	
}

